package com.joe.codemother.core.file;

import com.joe.codemother.ai.model.HtmlCodeResult;
import com.joe.codemother.core.SaveFileTemplate;
import com.joe.codemother.entity.enums.GenerateTypeEnum;

import java.io.File;

public class HtmlFileSaveTemplate extends SaveFileTemplate<HtmlCodeResult> {

    @Override
    protected GenerateTypeEnum generateType() {
        return GenerateTypeEnum.HTML;
    }

    @Override
    protected File saveFiles(HtmlCodeResult result, String dirPath) {
        this.saveFile(dirPath,"index.html",result.getHtmlCode());
        return new File(dirPath);
    }

    @Override
    protected boolean validateResult(HtmlCodeResult result) {
        return super.validateResult(result);
    }
}
